<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<style type="text/css">
	body{
		margin: 0;
		padding: 0;
		background-color: #eeeeee;
		font-family: "楷体";
	}
	.item{
		margin: 20px;
		margin-bottom: 50px;
	}
	.imte_top{
		text-align: center;
	}
	.imte_top>span{
		font-size:14px;
		display: inline-block;
		padding: 5px 12px;
		background-color: #ddd;
		color:#fff;
		border-radius: 5px;
	}
	.item_content{
		background-color: #fff;
		padding: 25px 15px;
		margin-top: 6px;
	}
	.item_content_top_1{
		font-size: 24px;
		font-weight: bold;
	}
	.item_content_top_2{
		color:#eee;
		font-size: 14px;
		margin: 5px 0px;
	}
	.item_content_top_3{
		margin: 10px 0px;
	}
	.item_content_top_4{
		margin: 10px 0px;
	}
	.item_content_bottom>a{
		text-decoration: none;
		color:#33e;
	}
</style>
</head>
<body>
	
	<div class="content" id="dataTable1">
		<h1 align="center">待护送快件空空如也 </h1>
	</div>
	<div class="content" id="dataTable2">
		<h1 align="center" >已取走快件查无记录</h1>

	</div>

</body>
<script src="js/jquery.min.js"></script>
<script src="layer/layer.js"></script>
<script>
	function getExpress(code) {
		let load = layer.load();
		$.getJSON("/wx/updateStatus.do", {code: code}, function (data) {
			layer.close(load);
			layer.msg(data.result);
		});
	}
$(function () {

   $.getJSON("/wx/findExpressBySysPhone.do",null,function (data) {
	   if (data.status0!=null) {
		   var data1 = data.status0;
		   $("#dataTable1").html("");
		   for (i = 0; i < data1.length; i++) {
			   var item = "<div class=\"item\">\n" +
					   "\t\t\t<div class=\"imte_top\"><span>" + data1[i].inTime + "</span></div>\n" +
					   "\t\t\t<div class=\"item_content\">\n" +
					   "\t\t\t\t<div class=\"item_content_top\">\n" +
					   "\t\t\t\t\t<div class=\"item_content_top_1\">待出库快递</div>\n" +
					   "\t\t\t\t\t<div class=\"item_content_top_2\">入库时间：" + data1[i].inTime + "</div>\n" +
					   "\t\t\t\t\t<div class=\"item_content_top_3\">用户:\'" + data1[i].username + "\'有一个包裹需要您护送出站了!</div>\n" +
					   "\t\t\t\t\t<div class=\"item_content_top_4\">\n" +
					   "\t\t\t\t\t\t取件码:<span style=\"color:#05a\">" + data1[i].code + "</span><br>\n" +
					   "\t\t\t\t\t\t快递公司:" + data1[i].company + "<br>\n" +
					   "\t\t\t\t\t\t运单号码:" + data1[i].number + "<br>\n" +
					   "\t\t\t\t\t\t用户电话:" + data1[i].userPhone + "<br>\n" +
					   "\t\t\t\t\t\t取件地址:少布列颠帝国驿站<br>\n" +
					   "\t\t\t\t\t</div>\n" +
					   "\t\t\t\t</div>\n" +
					   "\t\t\t\t<hr>\n" +
					   "\t\t\t\t<div class=\"item_content_bottom\">\n" +
					   "\t\t\t\t\t<a onclick=\"getExpress('" + data1[i].code + "')\">暂时代收</a>\n" +
					   "\t\t\t\t</div>\n" +
					   "\t\t\t</div>\n" +
					   "\t\t</div>";
			   $("#dataTable1").append(item);
		   }
	   }
	   if (data.status1!=null) {
		   var data2 = data.status1;
		   $("#dataTable2").html("");
		   for (i = 0; i < data2.length; i++) {
			   var item = "<div class=\"item\">\n" +
					   "\t\t\t<div class=\"imte_top\"><span>" + data2[i].outTime + "</span></div>\n" +
					   "\t\t\t<div class=\"item_content\">\n" +
					   "\t\t\t\t<div class=\"item_content_top\">\n" +
					   "\t\t\t\t\t<div class=\"item_content_top_1\">已出库快递</div>\n" +
					   "\t\t\t\t\t<div class=\"item_content_top_2\">出库时间：" + data2[i].outTime + "</div>\n" +
					   "\t\t\t\t\t<div class=\"item_content_top_3\">您完成了一个快递的护送使命!</div>\n" +
					   "\t\t\t\t\t<div class=\"item_content_top_4\">\n" +
					   "\t\t\t\t\t\t快递公司:" + data2[i].company + "<br>\n" +
					   "\t\t\t\t\t\t运单号码:" + data2[i].number + "<br>\n" +
					   "\t\t\t\t\t\t用户电话:" + data2[i].userPhone + "<br>\n" +
					   "\t\t\t\t\t</div>\n" +
					   "\t\t\t\t</div>\n" +
					   "\t\t\t\t<hr>\n" +
					   "\t\t\t\t<div class=\"item_content_bottom\">\n" +
					   "\t\t\t\t\t<a href=\"tel:" + data2[i].userPhone + "\">联系该快件主人</a>\n" +
					   "\t\t\t\t</div>\n" +
					   "\t\t\t</div>\n" +
					   "\t\t</div>\n" +
					   "\t\t</div>";

			   $("#dataTable2").append(item);
		   }
	   }
   });
});
</script>
</html>